package Eyjafjalla.card.dolly;

import Eyjafjalla.action.DrawCloudAction;
import Eyjafjalla.action.InDamageAfterDrawAction;
import Eyjafjalla.action.RandomBuffAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.modcore.ColorEnum;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class FXZ_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "FXZ_Eyjafjalla";
    private static final CardStrings cardStrings;

    public FXZ_Eyjafjalla(){
        super(ID, cardStrings.NAME,1,cardStrings.DESCRIPTION,CardType.SKILL, ColorEnum.Eyjafjalla_Dolly_COLOR,CardRarity.COMMON,CardTarget.NONE);
        setDolly();
        this.baseMagicNumber = 1;
        this.magicNumber = 1;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new FXZ_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new RandomBuffAction(magicNumber));
    }

    @Override
    public void applyPowers() {
        int trueM = baseMagicNumber;
        if(isFire()){
            baseMagicNumber++;
        }
        magicNumber = baseMagicNumber;
        baseMagicNumber = trueM;
        isMagicNumberModified = baseMagicNumber!=magicNumber;
        super.applyPowers();
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeBaseCost(0);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}

